package com.object.module.didi.frontendcontrolller;


import com.object.configuration.utils.Q;
import com.object.module.didi.entity.DdRoleEntity;
import com.object.module.didi.service.DdRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 角色
 *
 * @author 小🌤
 * @email 1578442339@qq.com
 * @date 2021-10-30 15:57:53
 */
@RestController
@RequestMapping("/didi/role")
public class FrontendDdRoleController {
    @Autowired
    private DdRoleService ddRoleService;



    /**
     * 信息
     */
    @RequestMapping("/info/{reId}")
    public Q info(@PathVariable("reId") Integer reId) {
            DdRoleEntity ddRole = ddRoleService.getById(reId);
            return Q.ok().put("ddRole", ddRole);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public Q save(@RequestBody DdRoleEntity ddRole) {
            ddRoleService.save(ddRole);
            return Q.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public Q update(@RequestBody DdRoleEntity ddRole) {
            ddRoleService.updateById(ddRole);
            return Q.ok();
    }



}
